<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page  
	errorPage="../include/eproErrorPage.jsp"
	contentType="text/html; charset=windows-874" 
	import=	"com.epro.standard.frontend.util.FileInfoUtil,
            com.epro.standard.frontend.util.ShowData,
            java.util.Vector,
           	com.softplus.carrefour.hd.bltier.entity.RoutePath,
  			com.softplus.carrefour.hd.bltier.admin.RoutePathManage,
 	 		com.softplus.carrefour.hd.bltier.entity.UserLevel,
 	 		java.text.SimpleDateFormat,
 	 		com.softplus.carrefour.hd.bltier.entity.CfhdCaseHead,
  			com.softplus.carrefour.hd.CFHDSystem"
%>
<HTML xmlns:epro>
<%@ taglib uri="/WEB-INF/HeadTag.tld" prefix="head"%>
<%@ taglib uri="/WEB-INF/TextfieldTag.tld" prefix="textfield"%>
<%@ taglib uri="/WEB-INF/ListboxTag.tld" prefix="listbox"%>
<%@ taglib uri="/WEB-INF/CheckboxTag.tld" prefix="CheckboxTag"%>
<head:Head 
	author="Dee" 
	title="Routing Setup : View"
	import="textfield,listbox,button,checkbox"
	jsFile="../script/imgProp.js,../script/Alert.js,../script/checkValidData.js,../script/lov.js"
	styleFile ="../theme/defaultTheme.css"></head:Head>
<%
	String uid = request.getParameter("uid")== null?"":request.getParameter("uid");
	
	String textfieldWidth   = "320" ;
	
	String linkParameter	= "?";
	
	SimpleDateFormat        dateFormat      = new SimpleDateFormat("dd/MM/yyyy");
	///////del
	//RoutePathManage routePathManage = (RoutePathManage)CFHDSystem.getControlClass("ROUTE_PATH");
   // Vector dataVector = new Vector();
	//dataVector = routePathManage.getRoutePathByCaseType("P2"); 
	//session.setAttribute("RoutingVector",dataVector);
	//if (true){
	///////del
	ShowData  showData 	    = new ShowData();
	
	if (request.getParameter("index") != null ){

		int       index         = Integer.parseInt(request.getParameter("index"));
     	if(index != 0) index = index-1;
     System.out.println("/////////////index====="+index);
        Vector    dataVector    = (Vector) session.getAttribute("RoutingVector");
	System.out.println("/////////////size====="+dataVector.size());	
		RoutePath data    		= (RoutePath)dataVector.elementAt(index);
		//RoutePath data    		= (RoutePath)dataVector.elementAt(0);
		//*******From To ******
		String fromUser = UserLevel.getLevelName(data.getComp_id().getFromUserLevel());
		
		//********Period ******
		String unattTime   	= showData.CheckNull(data.getUnattendPeriod());

String unattHours =unattTime.substring(0,unattTime.length()-2);
String unattMinutes = unattTime.substring(unattTime.length()-2);

		//------------------------------------------------------------------------------------------
//String unattHours =unattTime.substring(0,2);

//String unattMinutes = unattTime.substring(2,4);

//------------------------------------------------------------------------------------------
String autoEsTime = showData.CheckNull(data.getAutoEscalatePeriod());

//------------------------------------------------------------------------------------------
//String autoEsHours =autoEsTime.substring(0,2);
String autoEsHours =autoEsTime.substring(0,autoEsTime.length()-2);
//------------------------------------------------------------------------------------------
//String autoEsMinutes= autoEsTime.substring(2,4);
String autoEsMinutes = autoEsTime.substring(autoEsTime.length()-2);
		//********Route Direction*****
		String routeDirection 	= "";
		
		if(data.getRouteDirection().equals("E"))
		{
			routeDirection= "Escalate";
		}else if(data.getRouteDirection().equals("R"))
			  	{
					routeDirection= "Return";
				}
		//*******Default Route*********
		String defaultRoute 	= "";
		System.out.println("data.isDefaultAutoEscalate()===="+data.isDefaultAutoEscalate());
		
		if(data.isDefaultAutoEscalate())
		{
			defaultRoute= "Yes";
		}else{
					defaultRoute= "No";
			 }
		//*******Status Route*********
		String active 	= "";
		
		System.out.println("data.isStatus()===="+data.isStatus());
		
		if(data.isStatus())
		{
			active= "Active";
		}else {
					active= "Inactive";
			  }
	
	//***update by update date
	   	String updateBy         = showData.CheckNull(data.getUpdBy()) ;
    	String updateDate       = showData.CheckNull(data.getUpdDate(), "dd/MM/yyyy") ;
%>
<SCRIPT>
function Back()
{
	if (showOConfirmDialog("Confirm","Do you want to back?","OK","Cancel") == 1)
    {
		window.close();
	}
}
</SCRIPT>
<BODY>
<DIV style="width:100%;height:90%;margin:5px" class="modalBg">
<FORM name="frm">
	<TABLE>
	<TBODY>
	<TR>
    	<TD colspan="3">
    		<IMG alt="Back" src="../images/icon/toolbar/nExit.gif" onmouseover="this.src='../images/icon/toolbar/oExit.gif'" onmouseout="this.src='../images/icon/toolbar/nExit.gif'" style="cursor:hand" onclick="Back();">
        </TD>
	</TR>
	<TR>
	 	<TD width="40%" align="right" valign="top" class="titleFont">Case Type : </TD>
        <TD width="5"></TD>
        <TD class="dataDetailPK"><textfield:textfield  name="caseType" width="<%=textfieldWidth%>" readonly="yes" value="<%=CfhdCaseHead.getStatusDesc(data.getComp_id().getCaseType())%>"></textfield:textfield></TD>
    </TR>
    <TR>
	 	<TD width="40%" align="right" valign="top" class="titleFont">From User Level : </TD>
        <TD width="5"></TD>
        <TD class="dataDetailPK"><textfield:textfield  name="fromUserLevel" width="<%=textfieldWidth%>" readonly="yes" value="<%=UserLevel.getLevelName(data.getComp_id().getFromUserLevel()) %>"></textfield:textfield></TD>
    </TR>
	<TR>
	 	<TD width="40%" align="right" valign="top" class="titleFont">To User Level : </TD>
        <TD width="5"></TD>
        <TD class="dataDetailPK"><textfield:textfield  name="toUserLevel" readonly="yes" value="<%=UserLevel.getLevelName(data.getComp_id().getToUserLevel()) %>" width="<%=textfieldWidth%>" ></textfield:textfield></TD>
    </TR>
    <TR>
	 	<TD width="40%" align="right" valign="top" class="titleFont">Unattended Period : </TD>
        <TD width="5"></TD>
        <TD class="dataDetailPK"><textfield:textfield align="right" name="unattHours" readonly="yes" value="<%=unattHours%>" width="150" ></textfield:textfield>&nbsp;  :
        	<textfield:textfield  name="unattMinutes" align="right" readonly="yes" value="<%=unattMinutes%>" width="150" ></textfield:textfield></TD>
    </TR>
    <TR>
	 	<TD width="40%" align="right" valign="top" class="titleFont">Auto Escalate Period : </TD>
        <TD width="5"></TD>
        <TD class="dataDetailPK"><textfield:textfield align="right" name="unattHours" readonly="yes" value="<%=autoEsHours%>" width="150" ></textfield:textfield>&nbsp;  :
        	<textfield:textfield  name="unattMinutes" align="right" readonly="yes" value="<%=autoEsMinutes%>" width="150" ></textfield:textfield></TD>
    </TR>
    <TR>
	 	<TD width="40%" align="right" valign="top" class="titleFont">Route Direction : </TD>
        <TD width="5"></TD>
        <TD class="dataDetailPK"><textfield:textfield  name="routeDir" width="<%=textfieldWidth%>" readonly="yes" value="<%=routeDirection%>"></textfield:textfield></TD>
    </TR>
    <TR>
	 	<TD width="40%" align="right" valign="top" class="titleFont">Default Route for Auto Escalate : </TD>
        <TD width="5"></TD>
        <TD class="dataDetailPK"><textfield:textfield  name="defRoute" width="<%=textfieldWidth%>" readonly="yes" value="<%=defaultRoute%>"></textfield:textfield></TD>
    </TR>
   <TR>
	 	<TD width="40%" align="right" valign="top" class="titleFont">Updated By : </TD>
        <TD width="5"></TD>
        <TD class="dataDetailPK"><textfield:textfield  name="defRoute" width="<%=textfieldWidth%>" readonly="yes" value="<%=updateBy%>"></textfield:textfield></TD>
    </TR>
    <TR>
	 	<TD width="40%" align="right" valign="top" class="titleFont">Updated Date : </TD>
        <TD width="5"></TD>
        <TD class="dataDetailPK"><textfield:textfield align="center" name="active" width="<%=textfieldWidth%>" readonly="yes" value="<%=updateDate%>"></textfield:textfield></TD>
    </TR>
    
	</TBODY>
	</TABLE>
</FORM>
</DIV>
<%}%>
</BODY>
</HTML>
